package java6699.lesson14;

import java.io.*;
import java.net.Socket;

/**
 * @program: java_zzx
 * @description:
 * @author: zzx
 * @create: 2022-12-07 18:44x
 **/
public class TextClient6699 {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("192.168.11.188", 8086);
        //封装键盘中录入
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //封装通道内的数据
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
        String line = null;
        while ((line = br.readLine()) != null) {
            if ("stop".equals(line)) {
                break;
            }
            bw.write(line);
            bw.newLine();
            bw.flush();
        }
        socket.close();
    }
}
